//
//  RechargeViewController.m
//  WangLottery
//
//  Created by 黄修勇 on 12-5-19.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "RechargeViewController.h"

@interface RechargeViewController ()

@end

@implementation RechargeViewController

@synthesize rechargeTableView=_rechargeTableView;


-(void)dealloc{

    [_rechargeTableView release];
    [titleArray release];
    [super dealloc];
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title=@"帐户充值";
    
    _rechargeTableView.contentInset=UIEdgeInsetsMake(10.0f, 0.0f, 0.0f, 0.0f);
    titleArray=[[NSArray alloc]initWithObjects:@"支付宝安全充值(推荐)",@"支付宝手机支付",@"银联在线支付",@"银联语音支付",@"手机充值支付", nil];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.rechargeTableView=nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mar- UITableViewSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return [titleArray count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *cellString=@"recharge";
    
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellString];
    if (!cell) {
        cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellString] autorelease];
        cell.backgroundColor=[UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:0.4f];
    }

    cell.textLabel.text=[titleArray objectAtIndex:indexPath.row];
    cell.textLabel.backgroundColor=[UIColor clearColor];
    return cell;
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{

    return @"选择支付方式";
}

@end
